package cn.example.vip.mall.seckill.feign;

import cn.example.vip.mall.seckill.entity.SeckillGoods;
import cn.example.vip.mall.util.RespResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = "mall-seckill", path = "/seckill/goods", contextId = "mall-seckill-goods")
public interface SeckillGoodsFeign {
	
	/**
	 * 根据 seckillGoods ID 查询秒杀商品详情
	 * @param id
	 * @return
	 */
	@GetMapping("/{id}")
	RespResult<SeckillGoods> queryBySeckillId(@PathVariable("id") String id);
	
	/**
	 * 根据活动id 查询商品
	 * @param id
	 * @return
	 */
	@GetMapping("/act/{id}")
	RespResult<List<SeckillGoods>> queryByActId(@PathVariable("id") String id);
}
